{% extends 'xadmin/base.html' %}
{% load staticfiles %}

{% block title %}
    栏目组管理
{% endblock %}

{% block css %}
    <link href="{% static 'xadmin/css/cms.css' %}" rel="stylesheet">
    <link href="{% static 'xadmin/layui/css/layui.css' %}" rel="stylesheet" media="all">
    <link href="{% static 'xadmin/layui/dtree/font/dtreefont.css' %}" rel="stylesheet" media="all">
    <link href="{% static 'xadmin/layui/dtree/dtree.css' %}" rel="stylesheet" media="all">
    <link href="{% static 'xadmin/css/plugins/toastr/toastr.min.css' %}" rel="stylesheet" media="all">
{% endblock %}

{% block style %}
    <style>
        .lanmu-info *{
            -webkit-box-sizing: content-box!important;
            box-sizing: content-box!important;
        }
    </style>

{% endblock %}

{% block main %}

    <div class="col-sm-1 vertical-tab-box">
        <ul class="nav nav-second-level collapse in  vertical-tab" aria-expanded="true" style="">
            <li class="current"  sign="basic-info"><a href="javascript:;">基本信息</a>
            </li>
            <li class="content" sign="content-info"><a href="javascript:;">详情</a>
            </li>
        </ul>
    </div>
    <div class="col-sm-10">
        <form method="POST" class="form-horizontal cms-form" action="" enctype="multipart/form-data">
            {% csrf_token %}

            <div class="basic-info info">
                {% for field in article_group_form %}
                    {% if field.name != 'content' %}
                        {% if not forloop.first %}
                            <div class="hr-line-dashed"></div>
                        {% endif %}
                        <div class="form-group">
                            <label class="col-sm-2 control-label">{{ field.label }}</label>
                            <div class="col-sm-8">
                                {{ field }}
                                <span class="help-block m-b-none">{{ field.errors }}</span>
                            </div>
                        </div>
                    {% endif %}
                {% endfor %}
            </div>
            <div class="content-info info hidden">
                {% for field in article_group_form %}
                    {% if field.name == 'content' %}
                        {% if not forloop.first %}
                            <div class="hr-line-dashed"></div>
                        {% endif %}
                        <div class="form-group">
                            <label class="col-sm-2 control-label">{{ field.label }}</label>
                            <div class="col-sm-8">
                                {{ field }}
                                <span class="help-block m-b-none">{{ field.errors }}</span>
                            </div>
                            <div class="col-sm-2">

                            </div>
                        </div>
                    {% endif %}
                {% endfor %}
            </div>
            <div class="col-sm-4 col-sm-offset-2">
                <button class="btn btn-primary" type="submit">保存</button>
                <a class="btn btn-white" href="javascript:history.go(-1)">取消</a>
            </div>
        </form>
    </div>


{% endblock %}

{% block script %}
    <script src="{% static 'xadmin/ueditor/ueditor.config.js'%}"></script>
    <script src="{% static 'xadmin/ueditor/ueditor.all.js'%}"></script>
    <script src="{% static 'xadmin/layui/layui.all.js'%}"></script>
    <script src="{% static 'xadmin/js/plugins/toastr/toastr.min.js'%}"></script>


    <script>
        var ue = UE.getEditor('id_content', {'min-height': '800px'});


        //标签切换
        $('.vertical-tab li').click(function(){
            $(this).addClass('current').siblings().removeClass('current');
            var sign = $(this).attr('sign');
            $('.' + sign).removeClass('hidden').siblings('.info').addClass('hidden');
        });
    </script>
{% endblock %}